package com.baidu.dtx.inventory.controller;

import com.baidu.dtx.inventory.dto.InventoryDTO;
import com.baidu.dtx.inventory.service.InventoryService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @author shilei
 * @create 2021-05-13 22:35
 */
@RestController
@Slf4j
public class InventoryController
{
    @Resource
    private InventoryService inventoryService;

    @RequestMapping("/inventory/decrease")
    public String decrease(@RequestBody InventoryDTO inventoryDTO)
    {
        log.info("-----进入库存InventoryController");
        String result = inventoryService.decrease(inventoryDTO);
        log.info("-----进入库存InventoryController end");
        return result;
    }
}
